import { ApiProperty } from '@nestjs/swagger';
import {
  ArrayNotEmpty,
  IsArray,
  IsNotEmpty,
  IsPhoneNumber,
} from 'class-validator';
import { QueryFeiShuTenantAccessTokenType } from './query-feishu-tenant-access-token.dto';

export class GetBatchOpenIdByPhoneDto {
  @ApiProperty({
    description: '自建应用',
    example: 'yu_an_gpt',
  })
  @IsNotEmpty({ message: '自建应用不能为空' })
  tenant: QueryFeiShuTenantAccessTokenType;
  @ApiProperty({
    description: '自建应用的用户手机号数组',
    example: ['13616859570'],
  })
  @IsArray()
  @ArrayNotEmpty()
  @IsPhoneNumber('CN', { each: true })
  mobiles: string[];
}
